package ru.papergames.battleserver.network.serverpackets.flashuser;

/**
 * @author: atroshanin
 * Date: 12.09.2010
 * Time: 12:52:18
 */
public class MessageFromWebServer extends PaperGameServerPacket {
    private long time;
    private byte[] messageBytes;
    private boolean privateMsg;

    public MessageFromWebServer(long time, byte[] messageBytes, boolean privateMsg) {
        this.time = time;
        this.messageBytes = messageBytes;
        this.privateMsg = privateMsg;
    }

    @Override
    protected int getPacketId() {
        return MESSAGE_FROM_WEB_SERVER_PACKET_ID;
    }

    @Override
    protected void writePacketData() {
        writeQ(time);
        writeBool(privateMsg);
        writeH(messageBytes.length);
        writeB(messageBytes);
    }

}
